﻿using Guolian.ProjectName.Infrastruct;
using Guoling.ProjectName.Application;
using Guoling.ProjectName.Data;

namespace Guoling.ProjectName.Web
{
    public class NativeInjectorBootStrapper
    {
        public static void RegisterServices(IServiceCollection services) 
        {
            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();

            services.AddDbContext<ApiDbContext>();
            //application
            services.AddScoped<IUserAppService, UserAppService>();
            services.AddScoped<IOrderAppService, OrderAppService>();

            //基础设施层
            services.AddScoped<IUserRepository, UserRepository>();
            services.AddScoped<IOrderRepository, OrderRepository>();
        }
    }
}
